package guicommon.gui;

import guicommon.Header;
import guicommon.controls.Window;
import java.nio.CharBuffer;

public class WindowMessage extends ControlMessage {

    public static final Integer ID = 1;

    public static final String TITLE = "title";

    WindowMessage(Header header, CharBuffer buffer) {
        super(header, buffer);
    }

    public WindowMessage() {
        super(WindowMessage.class, ID);
    }

    public void SetTitle(String message) {
        SetBodyField(TITLE, message);
    }

    private String GetTitle() {
        return GetBodyField(TITLE);
    }

    @Override
    public Window ToControl() {
        Window result = new Window();
        SetCommonFields(result);
        result.SetTitle(GetTitle());
        return result;
    }
}
